package com.ruoyi.project.zxcrm.mapper;


import com.ruoyi.common.zx.PageData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 订单跟踪Mapper接口
 *
 * @author wenrui
 * @date 2022-12-30
 */
@Mapper
public interface CrmLeadMapper {
    /**
     * 查询订单跟踪
     *
     * @param id 订单跟踪主键
     * @return 订单跟踪
     */
    public PageData selectCrmLeadById(Long id);

    /**
     * 查询订单跟踪列表
     *
     * @param pd 订单跟踪
     * @return 订单跟踪集合
     */
    public List<PageData> selectCrmLeadList(PageData pd);

//
//    @Select(" SELECT\n" +
//            "        count(*) from \n" +
//            "        crm_lead t1\n" +
//            "        LEFT JOIN bd_partner t2 ON t1.id = t2.id where t2.mobile = #{Phone} ")
//    public int selectCrmLeadPhoneOne(String Phone);

    public List<PageData> queryAll();

    /**
     * 新增订单跟踪
     *
     * @param pd 订单跟踪
     * @return 结果
     */
    public int insertCrmLead(PageData pd);

    /**
     * 修改订单跟踪
     *
     * @param pd 订单跟踪
     * @return 结果
     */
    public int updateCrmLead(PageData pd);


    /**
     * 删除订单跟踪
     *
     * @param id 订单跟踪主键
     * @return 结果
     */
    public int deleteCrmLeadById(Long id);

    /**
     * 批量删除订单跟踪
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCrmLeadByIds(Long[] ids);

    List<PageData> selectCrmLeadCommentList(PageData pd);

    int insertLeadComment(PageData pd);

    int updateUserId(@Param("ids") Long[] ids, @Param("user_id") Long user_id);

    List<PageData> queryLeadTime(Long id);
}
